var express = require('express');
var router = express.Router();

/* GET users listing. */
router.post('/', function (req, res, next) {
    const {username, password} = req.body
    if (username == 'admin' && password == 'admin') {
        res.send({
            code: 200,
            message: 'success',
            data: {
                userInfo: {
                    name: '花东红',
                    age: 24
                },
                token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODI5NDU5NTIsIm5hbWUiOiIxNTMwMTcxNjE3MiIsInVzZXJfaWQiOiIwMUdXMUQ2RERKN0RHWU5BRUhBWEhHRlpQWiJ9.3X3pqrZAQzUM-BZOz_EHwwHIiRFZaz3UewsfxICYr0c",
            }
        });
    } else {
        res.send({
            code: 400,
            message: '用户名不存在',
            data: {}
        });
    }

});

module.exports = router;
